<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表页面</title>
</head>
<body>
<h3 align="center" style="margin:50px auto 0px"><span style="color: green;">学生信息&nbsp;&nbsp;&nbsp;${sessionScope.user.username}</span></h3>

<table border="1" align="center" cellspacing="0" cellpadding="0" width="500" table-layout:fixed>
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${students}" var="st">
        <tr>
            <td>${st.sid}</td>
            <td>${st.sname}</td>
            <td>${st.sage}</td>
            <td>${st.ssex}</td>
            <td><a href="${pageContext.request.contextPath}/toEdit?sid=${st.sid}">修改</a>&nbsp;&nbsp;
                <a href="${pageContext.request.contextPath}/delete?sid=${st.sid}"
                   onclick="return confirm('确定删除？');">删除</a></td>
        </tr>
    </c:forEach>

</table>
<div align="center">
    <a href="${pageContext.request.contextPath}/add.jsp">新增</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="${pageContext.request.contextPath}/exit">退出</a>
</div>
</body>
</html>
